package cn.qihua.model;

/**
 * SysResource entity. @author MyEclipse Persistence Tools
 */

public class SysResource implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -2533580172566293247L;
	private Integer id;
	private String text;
	private String type;
	private String url;
	private Integer parentId;
	private String parentIds;
	private String permission;
	private Boolean available;

	// Constructors

	/** default constructor */
	public SysResource() {
	}

	/** full constructor */
	public SysResource(String text, String type, String url, Integer parentId,
			String parentIds, String permission, Boolean available) {
		this.setText(text);
		this.type = type;
		this.url = url;
		this.parentId = parentId;
		this.parentIds = parentIds;
		this.permission = permission;
		this.available = available;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getParentId() {
		return this.parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public String getParentIds() {
		return this.parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}

	public String getPermission() {
		return this.permission;
	}

	public void setPermission(String permission) {
		this.permission = permission;
	}

	public Boolean getAvailable() {
		return this.available;
	}

	public void setAvailable(Boolean available) {
		this.available = available;
	}
	
    public boolean isRootNode() {
        return parentId == 0;
    }

}